<fieldset>

    <legend>{{$legend}}</legend>

    <div class="am-tabs am-margin" data-am-tabs>

        <div class="am-tab-panel am-fade am-in am-active" id="tab1">
            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    {!! Form::label('category_id','所属栏目') !!}
                </div>
                <div class="am-u-sm-8 am-u-md-5 am-u-end col-end">
                    {{--<select name="category_id"--}}
                    {{--data-am-selected="{btnWidth: '100%',  btnStyle: 'secondary', btnSize: 'sm', maxHeight: 260, searchBox: 1}">--}}

                    {{--@foreach($categories as $category)--}}
                    {{--<optgroup label="{{$category->name}}">--}}
                    {{--@foreach($category->children as $child)--}}
                    {{--<option value="{{$child->id}}"--}}
                    {{--@if($child->id == $article->category_id) selected @endif--}}
                    {{-->&nbsp;&nbsp;&nbsp;&nbsp;|--{{$child->name}}--}}
                    {{--</option>--}}
                    {{--@endforeach--}}
                    {{--</optgroup>--}}
                    {{--@endforeach--}}

                    {{--</select>--}}

                    {!! Form::select('category_id', $cates, $article->category_id, ['placeholder' => '顶级分类']) !!}
                </div>
            </div>

            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    {!! Form::label('title','文章标题') !!}
                </div>
                <div class="am-u-sm-8 am-u-md-5 am-u-end col-end">
                    {!! Form::text('title',null,['class'=>'am-input-sm','placeholder'=>'请输入文章标题']) !!}
                </div>
                <div class="am-hide-sm-only am-u-md-5">* 必填</div>
            </div>

            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    {!! Form::label('author','文章作者') !!}
                </div>
                <div class="am-u-sm-8 am-u-md-5 am-u-end col-end">
                    {!! Form::text('author',null,['class'=>'am-input-sm','placeholder'=>'请输入文章作者']) !!}
                </div>
            </div>


            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    {!! Form::label('from','信息来源') !!}
                </div>
                <div class="am-u-sm-8 am-u-md-5 am-u-end col-end">
                    {!! Form::text('from',null,['class'=>'am-input-sm','placeholder'=>'请输入信息来源']) !!}
                </div>
                <div class="am-hide-sm-only am-u-md-5">* 选填</div>
            </div>

            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    {!! Form::label('thumb','缩略图') !!}
                </div>
                <div class="am-u-sm-8 am-u-md-5 am-u-end col-end">
                    <div class="am-form-group am-form-file">
                        <button type="button" class="am-btn am-btn-success am-btn-sm">
                            <i class="am-icon-cloud-upload" id="loading"></i> 上传新的文章图
                        </button>
                        {!! Form::file('image_upload',['id'=>'imgae_upload']) !!}
                        {!! Form::hidden('thumb') !!}
                    </div>
                    <div>
                        <img src="{{ $article->thumb or 'https://images.itfun.tv/school/images/common/user_noimg.png
' }}" id="img_show" style="max-height: 200px;">
                    </div>
                </div>
            </div>

            <hr>

            <div class="am-g am-margin-top-sm">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    {!! Form::label('description','描述信息') !!}
                </div>
                <div class="am-u-sm-8 am-u-md-5 am-u-end col-end">
                    {!! Form::textarea('description',null,['class'=>'am-input-sm','placeholder'=>'请输入描述信息']) !!}
                </div>
            </div>

            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    {!! Form::label('is_top','是否置顶') !!}
                </div>
                <div class="am-u-sm-8 am-u-md-5 am-u-end col-end">
                    <div class="am-form-group">
                        <label class="am-radio-inline">
                            {!! Form::radio('is_top',1,true) !!} 是
                        </label>
                        <label class="am-radio-inline">
                            {!! Form::radio('is_top',0) !!} 否
                        </label>
                    </div>
                </div>
            </div>


            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    {!! Form::label('content','文章内容') !!}
                </div>
                <div class="am-u-sm-12 am-u-md-12">
                    <div id="markdown">
                        {!! Form::textarea('content',null,['style'=>'display:none']) !!}
                    </div>
                </div>
            </div>

        </div>
    </div>

    <div class="am-margin">
        {!! Form::submit('提交保存',['class'=>'am-btn am-btn-primary am-btn-xs']) !!}
        {!! link_to_asset('/admin/crm/article','放弃保存',['class'=>'am-btn am-btn-primary am-btn-xs']) !!}
    </div>
</fieldset>